fn main() {

    pub trait LiveNew {
        fn new() -> Self;
    }

    #[derive(Debug)]
    struct Width(u32);

    impl std::ops::Deref for Width {
        type Target = u32;
        fn deref(&self) -> &Self::Target {
            &self.0
        }
    }

    impl LiveNew for Width {
        fn new() -> Self {
            Self(0)
        }
    }

    #[derive(Debug)]
    struct Window {
        width: Width,
        height: u32,
    }

    impl LiveNew for u32 {
        fn new() -> Self {
            0
        }
    }

    impl LiveNew for Window {
        fn new() -> Self {
            Self {
                width: LiveNew::new(),
                height: Default::default(),
            }
        }
    }

    //let w = <Width as LiveNew>::new();
    let w = <Window as LiveNew>::new();

    //println!("{:?}", *w);
    println!("{:?}", *w.width);

}